package com.wyw.leetcode.learning.simple;

/**
 * leetcode topic 1480
 * 一维数组动态和
 *
 * @Author Mr Wu    yewen.wu.china@gmail.com
 * <p>
 * Update History:
 * Author        Time            Content
 */
public class Topic1480 {

    public static void main(String[] args) {
        int[] nums = new int[] {1,2,3,4};
        runningSum(nums);
        System.out.println("end");
    }

    public static int[] runningSum(int[] nums) {
        int length = nums.length;
        for(int i = 1; i<length; i++) {
            nums[i] += nums[i-1];
        }
        return nums;
    }
}
